export default{
    
    reg_name(newname,oldname) {
        if(/^[a-zA-Z0-9_-]{4,16}$/.test(newname)){
            this.zsg = "用户名格式输入正确"
            
        }else{
            this.zsg = '用户名格式输入错误'
            if(this.reg_name == ''){
                this.zsg = '请输入4到16位不包含特殊符号的用户名'
            }
        }
    },
    reg_psd(newpsd,oldpsd){
        if(/^.*(?=.{6,})(?=.*\d)(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*? ]).*$/.test(newpsd)){
            this.psg = '密码格式正确'
        }else{
            this.psg = '密码格式不正确'
            if(this.reg_psd == ''){
                this.psg = '密码大于6位并且包含大小写数字和特殊字符'
            }
        }
    },
    reg_confirm_psd(newreg,oldreg){
        if(newreg === this.reg_psd  ){
            this.msg = '密码一致'
            if(this.reg_confirm_psd == ''){
                this.msg = ''
            }
          }else{
              this.msg = '密码不一致'
          }
    }
}